Repository navigation
feat: 내 템플릿 목록 API (#66) - #68
Merged
Merged
Conversation
# Conflicts: # src/main/java/com/sniptext/domain/template/repository/TemplateRepository.java
oTAETAEo
marked this pull request as ready for review
November 7, 2026 04:36
chjpooh2002
approved these changes
Nov 9, 2026
chjpooh2002
left a comment
Contributor
There was a problem hiding this comment.
사소한 리뷰 하나 남겼으니 확인 부탁드립니다!
|
|
||
| /** 내 템플릿 목록. 휴지통을 제외한 전체를 생성 순으로 */ | ||
| public TemplateListResult getTemplates(Long userId) { | ||
| List<TemplateListItemResult> templates = templateRepository.findAllByUserIdAndDeletedAtIsNullOrderByIdAsc(userId) |
Contributor
There was a problem hiding this comment.
본문 복호화는 엔티티를 읽을 때 변환기에서 일어나서, 복호화에 실패하는 행이 하나라도 있으면 목록 전체가 500이 될 것 같아요. 그러면 사용자는 대시보드를 아예 못 보고, 그 템플릿을 휴지통으로 보낼 수도 없게 돼요. 이 PR에서 고칠 필요는 없지만, 깨진 행을 어떻게 다룰지(건너뛰고 로그를 남길지, 지금처럼 500으로 둘지) 이슈로 남겨두면 좋을 거 같습니다!
Contributor
Author
There was a problem hiding this comment.
좋습니다! 복호화 실패는 키가 다르거나 저장값이 변조된 경우에만 나고, 키 문제라면 행 하나가 아니라 전체가 깨져서 건너뛰어도 의미가 없을 것 같아요. 지금은 500으로 두고, 나중에 키 교체를 도입하면 그때 같이 다루겠습니다 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 내용
명세 8번
GET /api/v1/templates를 구현했습니다. 인증된 본인의 휴지통 제외 템플릿 전체를 생성 순(템플릿 ID 오름차순)으로 내려주고, 페이지는 나누지 않습니다.커밋별로 보기
findAllByUserIdAndDeletedAtIsNullOrderByIdAsc(메서드 추가만)TemplateQueryService.getTemplates(Long userId),TemplateListResult,TemplateListItemResultGET /api/v1/templates,TemplateListResponse,TemplateListItemResponse,TEMPLATE200_1develop병합(feat: 휴지통 템플릿 복구 API (#67) #69 휴지통 복구), 복구 테스트를 실제 복구 API로 교체variables는 복호화한 본문에서TemplateVariableExtractor.extract로 뽑습니다.totalCount는 명세 타입(Integer)에 맞춰int이고, 목록 길이로 채웁니다. 개수 쿼리를 따로 두지 않았습니다.sort파라미터와TEMPLATE400_8은 v0.8에서 삭제되어 만들지 않았습니다.명세와 달라진 점
없음
테스트
TemplateListControllerTest(테스트컨테이너 MySQL)+09:00,no-storePOST /api/v1/trash/templates/{id}/restore)를 부른 뒤 목록을 확인합니다totalCount: 0·빈 배열lastUsedAtnullCOMMON401_1TemplateListRepositoryTest: 범위(휴지통·다른 회원 제외)와 ID 오름차순, 빈 목록TemplateQueryServiceTest(모키토): 레포지토리 순서 유지, 개수, 변수 목록, 빈 목록확인 체크리스트
./gradlew build통과global공통 코드 변경 없음리뷰어에게
EXPLAIN으로 확인했습니다 (20명·600행,ANALYZE후).WHERE user_id = ? AND deleted_at IS NULL ORDER BY id ASC는type=ref,key=idx_templates_user_deleted,ref=const,const, ExtraUsing index condition이고Using filesort가 없습니다. ERD 메모대로 인덱스 끝의 기본 키 순서를 그대로 씁니다. 인덱스·마이그레이션은 추가하지 않았고, 확인용 임시 테스트는 지웠습니다🤖 Generated with Claude Code